package com.hqyj.springboot.modules.account.dao;

import com.hqyj.springboot.modules.account.entity.RoleResource;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Repository;

@Mapper
@Repository

public interface RoleResourceDao2 {

    @Insert("insert into test_role_resource (creat_date,update_date,role_id,resource_id) values (#{createDate},#{updateDate},#{roleId},#{resourceId})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    void addRoleResource(RoleResource roleResource);

    @Delete("delete from test_role_resource where role_id =#{id}")
    void deleteRoleResourceByRoleId( int id);

    @Delete("delete from test_role_resource where resource_id =#{id}")
    void deleteRoleResourceByResourceId( int id);
}
